package com.personalsystem.tool.hibernate;

import java.io.Serializable;
import java.util.List;

import com.personalsystem.tool.page.Page;


public interface BaseDao<T extends Serializable> {

	public T load(Serializable id, boolean lock);

	public T get(Serializable id);


	public T load(Serializable id);


	public List<T> findAll();


	public Page findAll(int pageNo, int pageSize, OrderBy... orders);


	public List<T> findByEgList(T eg, boolean anyWhere, Condition[] conds,
			String... exclude);

	public List<T> findByEgList(T eg, boolean anyWhere, Condition[] conds,
			int firstResult, int maxResult, String... exclude);

	public Page findByEg(T exampleInstance, boolean anyWhere,
			Condition[] conds, int pageNo, int pageSize, String... exclude);

	public List<T> findByProperty(String property, Object value);

	public T findUniqueByProperty(String property, Object value);

	public int countByProperty(String property, Object value);

	public Object updateByUpdater(Updater updater);

	public Object updateDefault(Object entity);

	public T save(T entity);

	public Object update(Object entity);

	public Object saveOrUpdate(Object entity);

	public Object merge(Object entity);

	public void delete(Object entity);

	public T deleteById(Serializable id);

	public void refresh(Object entity);

	public Class<T> getPersistentClass();

	public T createNewEntiey();
}
